$(function () {
        $("#jqGrid").jqGrid({
            url: baseURL + 'water/taccountmanage/status',
            datatype: "json",
            colModel: [
                { label: '小区类型', name: 'proType', index: 'proType', width: 50 },
                { label: '区域', name: 'areaName', index: 'areaName', width: 80 },
                { label: '分所', name: 'unitName', index: 'unitName', width: 80 },
                { label: '小区', name: 'proName', index: 'proName', width: 80 },
                { label: '竣工日期', name: 'useDate', index: 'useDate', width: 80 },
                { label: '超期总数', name: 'over3', index: 'over3', width: 80 },
                { label: '超期三年', name: '', index: '', width: 80,
                    formatter: function(value, options, row){
                        return row.over3-row.over6;
                    }
                },
                { label: '超期六年', name: 'over6', index: 'over6', width: 80 }
            ],
            viewrecords: true,
            height:$(window).height()-100,
            rowNum: 3000,
            rownumbers: true,
            rownumWidth: 50,
            autowidth:true,
            jsonReader : {
                root: "page",
                page: "page.currPage",
                total: "page.totalPage",
                records: "page.totalCount"
            },
            prmNames : {
                page:"page",
                rows:"limit",
                order: "order"
            },
            gridComplete:function(){
                //隐藏grid底部滚动条
                $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
            }
        });
});

$(function(){
    $(window).resize(function(){
        $("#jqGrid").setGridHeight($(window).height()-100);
    });
});

var vm = new Vue({
	el:'#rrapp',
	data:{
		showList: true,
		title: null,
		tDataErr: {}
	},
	methods: {
		query: function () {
			vm.reload();
		},
		reload: function (event) {
			vm.showList = true;
			var page = $("#jqGrid").jqGrid('getGridParam','page');
			$("#jqGrid").jqGrid('setGridParam',{ 
                page:page
            }).trigger("reloadGrid");
		}
	}
});